package com.lpx.blog.task;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author: ColorSheep
 * @Description: TODO
 * @Date: 2024/11/21 19:34
 * @Version: 1.0
 */
@Component
@Slf4j
public class TestLifeJobHandler {

	@XxlJob(value = "lifeJobHandler", init = "init", destroy = "destroy")
	 public void demoJobHandler2() throws Exception {
        System.out.println("欢迎来到定时任务");
        XxlJobHelper.log("XXL-JOB, Hello World.");
        for (int i = 0; i < 5; i++) {
            XxlJobHelper.log("beat at:" + i);
        }
    }

	public void init() {
		log.info("我在初始化");
	}

	public void destroy() {
		log.info("我被销毁了");
	}

}
